Printing apparatus, data storage medium, interface device, printer control method, and interface control method

ABSTRACT

An interface device backs up printer settings and operating history data of printer so that the settings and history data can be easily restored. A nonvolatile memory  109  in the printer  101  stores printer settings data. Commands from a host  161  are passed by the interface device  131  and received by a receiver  103  within the printer. If the command data is a print command, the print mechanism  108  prints the specified text or image. If the command data is a command for updating the settings data, the corresponding settings data in the nonvolatile memory  109  is updated and at an appropriate backup time the updated settings data is copied to a nonvolatile memory  135  in the interface device  131 . The settings data backed up into the interface device  131  can then be restored back to the printer&#39;s nonvolatile memory  109  at an appropriate data restore time.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional of, and claims priority under 35 U.S.C.§ 120 from U.S. application Ser. No. 09/942,828 filed on Aug. 29, 2001.Japanese Patent application No. 2000-261084 filed Aug. 30, 2000 fromwhich application Ser. No. 09/942,828 claims priority under 35 U.S.C. §119, is hereby incorporated by reference in its entirety.

BACKGROUND

1. Field of Invention

The present invention relates generally to a printer, a data storagemedium, an interface device, a printer control method, and an interfacecontrol method. More specifically, this invention relates to a printerthat is useful for backup storage of printer settings and operatinghistory data, an interface device, a printer control method, aninterface control method, and a computer-readable data storage mediumfor recording a program that achieves the backup storage functions.

2. Description of Related Art

There are many prior art printers that store printer settings in flashEEPROM (Electrically Erasable Programmable Read Only Memory). Thisinformation is used to restore printer settings when the power is turnedon so that the printer operates according to the preferred usersettings. Such printers also typically store such historical data as inkcartridge replacement data, ink consumption, the number of pagesprinted, and the remaining ink volume to flash EEPROM. This printeroperating history can then be examined to help reduce printing costs,improve ink characteristics, and make other various improvements to theprinter.

Different interface standards (such as RS-232C, USB (Universal SerialBus), and parallel) can also be used to connect the printer with thehost device that sends print commands, printer settings, and othercommand data to the printer. Interface devices are used to convert theTTL voltage level and the specific interface standard used by the hostdevice for communication with the printer. Modular interface devicetechnologies enabling a printer's interface device to be replaced arealso available. This makes it possible to make a printer compatible withdifferent communication interfaces by simply installing the appropriateinterface device. Existing printers can therefore be made compatiblewith new interface standards by simply replacing the interface device.

A problem with such prior art printers is that the flash EEPROM istypically mounted on the same main circuit board on which the printercontrol CPU, RAM used for temporary storage by the printer, ROM fornonvolatile storage of the printer initialization program and font data,and other components are mounted. In the prior art, when a problemarises in any one of these components causing the main board tomalfunction it is difficult to extract the settings and historical datastored in the main board's flash EEPROM and restore this data to anotherflash EEPROM on a replacement board.

There is therefore a need for technology that enables printer settingsand history data to be easily backed up so that the settings and historydata can be easily restored following the repair of a printer's maincircuit board.

OBJECTS OF THE INVENTION

Therefore, it is an object of the present invention to overcome theaforementioned problems.

It is another object of the present invention to provide a solution thatmakes use of the aforementioned modular interface device.

SUMMARY OF INVENTION

The present invention is therefore directed to a solution for the aboveproblem, and an object of this invention is to provide a printer that isuseful for backing up printer settings and history data, an interfacedevice, a computer-readable data storage medium for recording a programthat stores these settings and history data to the printer, and aprinter control method and an interface control method typicallyachieved by running said program.

User-defined printer settings and printer history data such as inkconsumption, referred to below as the “protected data,” are updated tovalues different from default settings (values preset at the factoryprior to shipping), and stored to a rewritable protected data memorylocated on a main circuit board of the printer. As a result ofaccumulated research into a solution for the problems described above,it has been found that by storing, i.e. backing up, this protected dataat specific times to a rewritable protected, i.e. nonvolatile, datareserve memory located in an interface device, or other componentseparate from the main circuit board, the protected data can be easilyrestored from this rewritable protected data reserve memory to anotherrewritable protected data memory located on a newly installed maincircuit board when the previous main circuit board malfunctions and isreplaced.

A printer according to a first aspect of our invention has a rewritableprotected data memory unit for storing protected data including printersettings and history data; a receiver for receiving command data from ahost device through an interface device; a printing unit for printingprint document data based on print data from the command data receivedby the receiver; a data update unit for updating the protected data; anda data protection unit for backing up and restoring the protected dataupdated by the data update unit.

The data protection unit preferably has a backup unit for copying theprotected data stored in the protected data memory unit to a datarewritable protected data reserve memory unit at specific times or inresponse to specific events.

Further preferably, the data protection unit also has a data restoreunit for restoring protected datafrom the protected data reserve memoryunit to the protected data memory unit at specific times or in responseto data restore events. The restored data is preferably data previouslystored by the backup unit into the protected data reserve memory unit.

The data protection unit preferably also has a backup/restore controlunit for determining when to initiate a backup and a restore sequence inaccordance with specific events.

Yet further preferably, the protected data reserve memory unit isdisposed in the interface device, but it is to be understood that theprotected data reserve memory unit may also be located on an auxiliarycomputer board within the printer and separate from the main board onwhich resides the protected data memory unit.

A printing apparatus according to another aspect of our inventionincludes a receiver, a printing unit, a data update unit, a backup unit,and a nonvolatile data memory unit for storing selected data that is tobe protected and maintain even when power is removed from the printer.The printing apparatus is further connected to a host device through aninterface device having a reserve memory unit for storing at leastcopies of the selected data stored in the nonvolatile data memory unit.The reserve memory unit is preferably nonvolatile memory.

The selected data stored in the nonvolatile data memory unit of thisprinter preferably includes printer settings data.

The printing apparatus's receiver receives command data sent from a hostdevice and relayed by the interface device. The printing unit printstext or image data when the received command data is a print commandspecifying text or image data. The data update unit updates the printersettings data when the received command data is an instruction forupdating the settings data stored in the nonvolatile data memory unit.The backup unit copies the updated printer settings data from thenonvolatile data memory unit to the nonvolatile, reserve memory unit ofthe interface device.

Further preferably, the backup unit of this aspect in the inventioncopies and stores the settings data when the settings data is updated bythe data update unit.

Yet further preferably, the backup unit in this aspect of the inventioncopies and stores the settings data when the printing apparatus's poweris turned on.

Yet further preferably, the printing apparatus also has a power offcommand input means. In this case, the power off command input meansaccepts commands that request an interruption of power supply to theprinting apparatus, and when such a power off command is received, thebackup unit copies and stores the settings data.

Yet further preferably, the printing apparatus also has a data restoreunit for copying printer settings data from the reserve memory unit ofthe interface device to the nonvolatile data memory unit.

Yet further preferably, the data restore unit copies and saves theprinter settings data from the reserve memory unit to the nonvolatiledata memory unit if, upon turning on the printing apparatus, it is foundthat printer settings data is not stored in the nonvolatile data memoryunit. No copy and restore operation is implemented, however, if it isfound that the printer settings data is also not stored in the reservememory unit. In other words, the data restore unit reads the data storedin the reserve memory unit, and if the back unit determines that it doesnot hold data values different from the factory issued default values,then no update and restore sequence is implemented.

A further aspect of our invention is a computer-readable data storagemedium for recording a program causing a computer connected to a hostdevice through an interface device having a protected data reservememory unit to function as a printing apparatus according to thisinvention as described herein.

This data storage medium includes the following: a Compact Disc, afloppy disk, a hard disc, a magneto-optical disc, a digital video discor digital versatile disc, a magnetic tape, semiconductor memory, and amemory card.

This data storage medium could also be made accessible through a serveron the World Wide Web (WWW) so that the program can be downloaded toupdate a program stored in the computer and the updated program can berun by the computer (typically the CPU of the printer) to achieve aprinting apparatus according to our invention. In this situation, it ispreferred that the computer be an integral part of the printingapparatus. Alternatively, the program may be downloaded by a personalcomputer, PC, and then transferred from the PC to an attached printersuch that the printer achieves the above described backup and restoreperformance. In still another embodiment, the downloaded program combinethe functionality of an attached printer with those of the PC. Thiswould be advantageous in situations when the attached printer does nothave an interface device with an extra reserve memory unit. In thissituation, the printer may backup its onboard nonvolatile data memoryunit to the PC's internal nonvolatile memory, such as its hard drive.During restore operations, the data previously stored in the PC's harddrive may be downloaded to the printer's internal nonvolatile datamemory unit.

A further aspect of our invention is an interface device connected to aprinting apparatus having a nonvolatile data memory unit for storingsettings data and connected to a host device. The interface device has aprotected, i.e. nonvolatile, reserve data memory unit, a connectionunit, a relay receiver, and a relay transmitter.

The reserve memory unit stores settings data, and any other data thatshould be protected, stored in the nonvolatile data memory unit of theprinting apparatus. The connection unit connects the reserve memory unitto the printing apparatus in order to copy settings data and otherprotected data from the printing apparatus to the reserve memory unit.The relay receiver receives command data sent from the host device, andthe relay transmitter transmits the received command data to theprinting apparatus.

The connection unit in this aspect of the invention preferably alsoconnects the reserve memory unit to the printing apparatus for copyingsettings data and other protected data from the reserve memory unit tothe printing apparatus.

A further aspect of this invention is a printing apparatus controlmethod having the following steps: a receive step for receiving commanddata from a host device through an interface device; a printing step forprinting print document data based on the command data received by thereceive step; a data update step for updating protected data such asdata that should not be lost if power is removed from the printingapparatus, the protected data including settings data and history datastored to a rewritable nonvolatile data memory unit; and a dataprotection step for backing up protected data updated by the data updatestep.

The data protection step preferably includes a backup step for copyingthe protected data from the nonvolatile data memory unit to anonvolatile, rewritable data reserve memory unit at a specific backuptime or in response to specific events.

Yet further preferably, the data protection step also includes a datarestore step for copying protected data (which had been previouslycopied into the reserve memory unit in the backup step) from the reservememory unit to the printing apparatus's nonvolatile data memory unit ata specific data restore time or in response to a specific data restoreevent. The data protection step preferably also includes a timingcontrol step for requesting a backup operation and/or a restoreoperation in response to specific conditions.

Yet further preferably, the reserve memory unit is disposed in theinterface device.

A printer control method according to a further aspect of this inventioncontrols a printer having a protected, i.e. nonvolatile, settings datamemory unit for storing settings data and connected to a host devicethrough an interface device having a protected, i.e. nonvolatile, datareserve memory unit. for The printer control method has a receive step,a printing step, a data update step, and a data backup step.

The receive step receives command data sent from a host device andrelayed by the interface device. The printing step prints text or imagedata when the received command data is a print command specifying textor image data. The data update step updates the printer settings data inthe nonvolatile, settings data memory unit when the received commanddata is a command for updating settings data. The backup step copiessettings data from the nonvolatile, settings data memory unit to thenonvolatile, reserve memory unit of the interface device.

Preferably, the backup step copies and stores the settings data contentof the settings data memory unit to the reserve memory unit when thesettings data content is updated by the data update step.

Yet further preferably, the backup step copies and stores the settingsdata content of the settings data memory unit to the reserve memory unitwhen the printing apparatus's power turns on, unless the settings datamemory unit contains only default settings values.

Yet further preferably, the printer control method also has a power offcommand input step for accepting a command for interrupting the powersupply to the printing apparatus. In this case the backup step copiesand stores the settings data content of the settings data memory unit tothe reserve memory unit when a command for interrupting the printingapparatus's power supply is received, unless the settings data memoryunit contains only default settings values.

Yet further preferably, the printer control method also has a datarestore step for copying backed up settings data content from thereserve memory unit of the interface device to the nonvolatile, settingsdata memory unit.

Yet further preferably, the data restore step copies and saves thebacked up settings data when the printing apparatus's power turns on ifmost current settings data is not stored in the nonvolatile settingsmemory unit, but is available in the reserve memory unit of theinterface device.

A further aspect of this invention is an interface device control methodfor controlling an interface device connected to a host device and to aprinter having a protected data memory unit such that it resists theloss of its stored data content if power is removed from it. Theprotected memory unit is used for storing settings data and other datathat should be protected in case of power loss. The interface devicepreferably has a protected data reserve memory unit such that it alsoresists the loss of its stored data content if power is removed from it.The protected data reserve memory unit is effective for storing, i.e.backing up, settings data from the protected data memory unit of theprinter. The interface device control method has a storing step, a relayreceiving step, and a relay transmission step.

The storing step copies data content from the printer's protected datamemory unit to the interface device's protected data reserve memoryunit. The relay receiving step receives command data sent from the hostdevice, and the relay transmission step relays the received command datato the printing apparatus.

This interface device control method preferably also has a data restorestep for copying data content from the interface device's protected datareserve memory unit to the printer's protected data memory unit.

The interface device control method of this invention can be run andcontrolled by the printer. In this case it is not necessary to provide aCPU or other control means in the interface device.

Other objects and attainments together with a fuller understanding ofthe invention will become apparent and appreciated by referring to thefollowing description and claims taken in conjunction with theaccompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings wherein like reference symbols refer to like parts.

FIG. 1 is a schematic diagram of a printer and an interface deviceaccording to a preferred embodiment of the present invention.

FIG. 2 is a functional block diagram showing the functions of a generaldata protection unit in accord with the present invention, asimplemented in the CPU of FIG. 1 in combination with the printer'snonvolatile protected data memory unit, or as suitable forimplementation with discrete components.

FIG. 3 is a flow chart of the data protection process; and

FIG. 4 is a flow chart of the backup/restore control process shown inthe data protection process in FIG. 3.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

The present invention will be more fully understood from the followingdescription of a preferred embodiment thereof with reference to theaccompanying figures. It will be noted, however, that the followingembodiment is described by way of example only and shall not limit thescope of the present invention. It will be obvious to one with ordinaryskill in the related art that various alternative embodiments can beachieved by replacing any or all of the elements described below with afunctional equivalent, and that all such alternative embodiments arealso included in the scope of this invention.

FIG. 1 is a schematic diagram showing the parts of a printer andinterface device according to a preferred embodiment of the invention.The invention is described below with reference to FIG. 1.

The printer 101 communicates with a host 161 or other external devicethrough an interface device 131. When the host 161 sends command data tothe printer 101, the data is received by a relay receiver 132 ofinterface device 131. A convertor 133 handles voltage level conversionand interface standards conversion for the received command data, andpasses the result through a relay transmitter 134 to the printer 101.

A receiver 103 of printer 101 thus receives the command data sent frominterface device 131. When the receiver 103 detects that command datahas been received, it issues a receive interrupt signal to CPU 102,which controls printer 101. As part of the receive interrupt process,CPU 102 stores the command data to a receive buffer 105, which isillustratively implemented as a reserved memory block within RAM 104,and the receive interrupt process then ends.

When an interrupt is not generated, CPU 102 detects if the receivebuffer 105 is empty. If command data is stored in the receive buffer105, the CPU 102 reads and interprets the command data in FIFO (firstin, first out) order.

If the command data is a print command for printing text or graphics,the CPU 102 reads from ROM 106 the appropriate font information for thetext or graphics specified in the print command, and generates a printimage in a print buffer 107 area of RAM 104.

When the print buffer 107 becomes full or a carriage return is detectedin the interpreted command data, the print mechanism 108, which includesthe print head, platen, and paper feed rollers, is driven according tothe print image in the print buffer to print the text or graphic topaper, film, or other print medium.

If the command data is a printer setting command for setting aparticular printer setting of printer 101, the printer setting is storedto a nonvolatile memory 109, which may be flash EEPROM or other type offlash memory or rewritable nonvolatile memory. Ink consumption by theprint mechanism 108, the ink cartridge replacement date, or otherhistory data may also be stored into nonvolatile memory 109.

The printer settings data and history data stored to nonvolatile memory109 may include the following.

Printer settings data:

-   -   type of font used    -   paper size and orientation    -   margin size    -   print speed    -   print density    -   print medium type

History data:

-   -   ink replacement date, amount of ink used    -   number of lines printed    -   firmware version    -   operating time

It will be obvious that the above printer settings and history datastored to nonvolatile memory 109 are shown by way of example only, andother information can be stored. Furthermore, the printer settings andhistory data stored in nonvolatile memory 109 are sent to the interfacedevice 131 at different times. The determination of when to send thisdata to interface device 131 is further described below. The informationsent to the interface device 131, including the above printer settingsand history data, is referred to below as the “protected data”.

Protected data sent to the interface device 131 is stored intononvolatile memory 135 within interface device 131. The storing of thisprotected data to nonvolatile memory 135 is preferably controlled by CPU102 of printer 101.

CPU 102 of printer 101 also controls the copying of protected datastored in nonvolatile memory 135 of interface device 131 to nonvolatilememory 109 of printer 101. This restoring of data from interface device131 to printer 101 is conducted at different times, as explained below.It is therefore not necessary to provide a separate CPU in interfacedevice 131 to control nonvolatile memory 135.

Power to printer 101 can be turned on and off by operating a printerpower switch 110. When power is turned on, CPU 102 runs aninitialization program stored in ROM 106 and runs any commands from thehost.

When a power off instruction is detected due to power switch 110 beingswitched to its OFF position, CPU 102 first runs a specific shutdownprocess and then turns off the power to printer 101. This shutdownprocess includes, for example in case of an inkjet printer, a processfor cleaning the print head of the print mechanism 108.

Power is supplied (not shown in the figure) from printer 101 tointerface device 131 in accordance with operation of power switch 110.

Input and output, i.e. data transfer, of the protected data betweenprinter 101 and interface device 131 passes through connector 111 ofprinter 101 and connector 136 of interface device 131.

The nonvolatile memory 135 of interface device 131 is typicallyconnected directly to the bus of printer CPU 102 through connector 111and connector 136.

Note that nonvolatile memory 109 functions as a rewritable, protecteddata memory, i.e. it resists the loss of data if power is removed fromit. Such memories include flash memories, battery backed-up RAM, harddrive, etc. Similarly, nonvolatile memory 135 functions as a rewritableprotected data reserve memory.

The times at which a data backup signal is issued, referred to below asthe “data backup signaling,” in response to which CPU 102 of printer 101copies and stores, i.e. backs up, the protected data from nonvolatilememory 109 to nonvolatile memory 135 in interface device 131, includesthe following.

(1) The protected data is backed up if the protected data stored innonvolatile memory 109 differs from its default values when the powerswitch 110 is operated to turn on printer 101. Whether the storedprotected data differs from the default values can be determined by, forexample, detecting whether a particular counter value stored innonvolatile memory 109 is set to a known default value, or using achecksum, a CRC (Cyclic Redundancy Check), or other technology.

(2) The protected data is backed up if the power switch 110 is operatedto turn off printer 101. A mechanical process is generally part of theprinter shutdown process, and typically is relatively time-consuming.The protected data is therefore backed up to nonvolatile memory 135during this mechanical process.

(3) The protected data is backed up if command data is not received fora specific time and if the receive buffer 105 and print buffer 107 areboth empty. This is typical of a situation in which CPU 102 is idle, andthis idle time can therefore be used to backup the protected data.

(4) The protected data is backed up if the execution of a receivedcommand results in the updating of data stored in nonvolatile memory109. For example, the backup process is typically run whenever a commandchanges a printer setting.

(5) The protected data is backed up if the received command data is abackup command requesting the backing up of data from nonvolatile memory109 to nonvolatile memory 135. A data sequence such as follows can beused as a backup command (note that 0x is a prefix indicatinghexadecimal code).

0x1b 0x1d 0x73 0x01 0x00 0x03

It will be obvious to one with ordinary skill in the related art thatany of the backup triggering events noted above can be used individuallyor in various combinations.

The times at which a data restore signal is issued, referred to below asthe “data restoresignaling,” in response to which CPU 102 of printer 101restores the protected data by copying the protected data from thenonvolatile memory 135 of interface device 131 to nonvolatile memory 109of printer 101, includes the following.

(1) The protected data is restored if nonvolatile memory 109 is notappropriately formatted or its protected data is not correctly storedwhen the power switch 110 is operated to turn on the power to printer101. This situation occurs, for example, when the data stored innonvolatile memory 109 has been lost for some reason or when the maincircuit board has been replaced due to a malfunction. If this datarestore triggering mechanism is used, the repair technician does notneed access to the interface device 131 used by the printer 101. Afterthe printer 101 is repaired and the interface device 131 is reinstalled,the present data restore process automatically copies the protected datafrom the nonvolatile memory 135 of the interface device 131 to thenonvolatile memory 109 of the printer 101 when the power is turned on.

(2) The protected data is restored if the received command data is adata restore command requesting the restoring of data from nonvolatilememory 135 to nonvolatile memory 109. A data sequence such as followscan be used as a data restore command (note that Ox is a prefixindicating hexadecimal code).

0x1b 0x1d 0x73 0x02 0x00 0x03

When the main circuit board is repaired, the service technician, forexample, can send this command to the printer 101 to restore theprotected data.

It will be obvious to one with ordinary skill in the related art thatany of the restore triggering events noted above can be usedindividually or in various combinations.

In the example of FIG. 1, the protection unit of the present inventionis implemented by CPU 102, which not only determines when to initiate abackup and restore operation, but also controls their execution. FIG. 2shows a general block diagram of the functional blocks that constitutethe present data protection unit, along with a backup reserve memory anda printer's main nonvolatile memory. In FIG. 2, protected data memoryunit 221 corresponds to the printer's nonvolatile memory 109 of FIG. 1,and protected data reserve memory unit 222 corresponds to the interfacedevice's nonvolatile memory 135 of FIG. 1. While the remainingfunctional blocks 201-213 of FIG. 2 were previously attributed to CPU102 in the example of FIG. 1, the block diagram of FIG. 2 defines eachfunctional block individually to indicate that each may be implanted asa discrete component separate from CPU 102, or groups of functionalblocks may be incorporated into one or more logic devices separate fromCPU 102. Alternatively, some functional blocks may be implanted onboardCPU 102 while others are implemented off CPU 102 by other dataprocessing devices.

In FIG. 2, the data protection unit has an event controller 201, a databackup unit 202, and data restore unit 203.

The backup unit 202 reads the protected data from the protected datamemory 221, including as noted above printer settings set by the userand history data such as ink consumption that should not be lost ifpower is removed, and writes it to the protected data reserve memory222, which likewise resists the loss of data when power is removed. Asmay be necessary, the restore unit 203 reads from reserve memory 222 theprotected data originally stored in the protected data reserve memory222 by the backup unit 202, and writes it to the protected data memory221. The event controller 201 determines the data backup signaling anddata restore signaling in response to which the backup unit 202 andrestore unit 203 operate.

The event controller 201 also has an operation monitor 211, a backupevent controller 212, and restore event controller 213.

The operation monitor 211 determines when the backup unit 202 or restoreunit 203 operate based partly on the operations of printer 101,interface device 131, and operation requests, i.e. data commands, fromhost 161. As described previously with reference to FIG. 1, examples ofoperations that trigger backup unit 202 or restore unit 203 intooperation include the following: (1) when the printer's power turns on,(2) when printer's power turns off, (3) when CPU 102 has been idle for aspecific period, (4) when an update routine of protected data iscomplete, (5) when a data backup command is received from the host 161,and (6) when a data restore command is received from the host 161.

At the appropriate signaling of the operation monitor 211, the backupevent controller 212 reads the protected data from protected data memory221 and compares it with default settings preferably also stored in theprotected data memory 221 to determine whether the read protected datashould be written to protected data reserve memory 222. The backup eventcontroller 212 thus determines if data backup is necessary. Examples fordetermining if data backup is necessary are described below.

Backup example 1: Counter values for protected data, such as the numberof lines printed, printer operating time, automatic paper cutteroperations, and the number of memory rewrites, are assigned an initialdefault value, such as 0 for example. The protected data stored inprotected data memory 221 is compared with theses initial defaultvalues. If the counter values differs from its initial default value,then the protected data is backed up, otherwise no backup sequence isinitiated.

Backup example 2: A first checksum based on the initial default valuesis compared with a second checksum calculated for the protected datastored in protected data memory 221. If the checksums differ, then theprotected data is backed up, otherwise no backup sequence is initiated.

Backup example 3: Data stored in a predetermined address in protecteddata memory 221 is used as a rewrite flag, which is altered whenever theprotected data is altered. If this rewrite flag differs from a defaultvalue, then the protected data is backed up, otherwise no backupsequence is initiated. For example, if the initial value of the rewriteflag is 1 and any change of the protected data memory 221 clears therewrite flag to 0, a value 0 of the rewrite flag indicates that theprotected data has been updated at least once.

Backup example 4: An identification number (ID number) for the maincircuit board of printer 101 is stored both in the protected data memory221 and in the protected data reserve memory 222, which preferablyresides in the interface device. This makes it possible to determine ifthe interface device has been replaced by comparing the ID number storedin protected data memory 221 with the ID number stored in protected datareserve memory 222. If the ID numbers differ, then the protected data isbacked up, otherwise no backup sequence is initiated.

At the appropriate signaling of the operation monitor 211, the restoreevent controller 213 reads the protected data from protected datareserve memory 222 and compares it with its preset default settings,which may be stored in protected data reserve memory 222, to determinewhether to copy, i.e. restore, the read protected data to protected datamemory 221. The restore event controller 213 thus determines if a datarestore operation is necessary. Alternatively, the restore eventcontroller 213 may also check the data values stored in protected datamemory 221 of printer 101 to determine if they are set to default valuesprior to initiating a restore routine. Examples for determining the datarestore timing are described below.

Restoring data, example 1: Counter values for protected data such as thenumber of lines printed, printer operating time, automatic paper cutteroperations, and the number of memory rewrites are assigned an initialvalue, such as 0, for example. The protected data stored in protecteddata reserve memory 222 is compared with these initial values, and ifany one count value differs from its initial value, then the protecteddata is restored to protected data memory 221, otherwise no restoresequence is initiated.

Restoring data, example 2: A first checksum based on default initialvalues of the protected data is compared with a second checksumcalculated for the actual protected data stored in protected datareserve memory 222. If the checksums differ, then the actual protecteddata is restored to protected data memory 221, otherwise no restoresequence is initiated.

FIG. 3 is a flow chart of the present data protection, i.e. backup andrestore, process.

The CPU 102 first waits for a backup or restore triggering event fromthe printer 101, interface device 131, or the host 161 (S301), anddetermines (S302) the appropriate backup or restore process according tothe type of observed, triggering event.

It should be noted that the examples of the data backup and restoretriggering events described above with reference to FIG. 2 are used inthe following description. In addition, the backup process refers tocopying and storing protected data read from the protected data memory221 to the protected data reserve memory 222, and the data restoreprocess refers to copying and storing protected data from the protecteddata reserve memory 222 to the protected data memory 221.

In response to a printer power on event (step S302 returns a “power on”signal), the event controller 201 determines whether a condition for thebackup or restore process is true, and as explained above, runs thebackup or restore process (S303) as appropriate. Control then returns tostep S301 to wait for the next triggering event.

In response to a printer power off event (step S302 returns a “poweroff” signal), the event controller 201 determines whether the conditionsfor the backup or restore process are true, and as explained above, runsthe backup or restore process (S304) as appropriate. Control thenreturns to step S301 to wait for the next triggering event.

When the CPU 102 has been idle for the specified time (step S302 returnsan “idle time elapsed” signal), the event controller 201 determineswhether the conditions for the backup or restore process are true, runsthe backup or restore process (S305) as appropriate, and control thenreturns to step S301 to wait for the next triggering event.

In response to completion of a protected data update event (step S302returns a “data update”), the event controller 201 determines whetherthe conditions for the backup or restore process are true, runs thebackup or restore process (S306) as appropriate, and control thenreturns to step S301 to wait for the next triggering event.

When a backup command is received from the host 161 (step S302 returns a“backup command” signal), the protected data is read from protected datamemory 221 (S307), the read protected data is then stored to protecteddata reserve memory 222, a rewrite flag for the protected data memory221 is cleared to 0 (S308) in protected data reserve memory 222, andcontrol then returns to step S301 to wait for the next triggering event.

When a restore command is received from the host 161 (step S302 returnsa “restore command” signal), the protected data is read from protecteddata reserve memory 222 (S309), the read data is stored to protecteddata memory 221 (S310). If required, a write flag may be set, or clearedas appropriate, in protected data memory 221. Control then returns tostep S301 to wait for the next triggering event.

FIG. 4 is a flow chart of the routine for determining whether to backupor restore data as part of the data protection process.

First, the current protected data content is read from the protecteddata memory 221 (S401) and compared with the initial, or default, valuesof the protected data, which are preferably stored in a predeterminedsection of protected data memory 221, to determine if the currentprotected data content is set to the initial, i.e. default, values(S402). In this example the current protected data content is assumed tobe set to the initial values if any of the following conditions aretrue.

Condition 1: The counter values for individual protected data, such asthe number of lines printed, printer operating time, automatic papercutter operations, and the number of memory rewrites, are set to “0”.

Condition 2: A first checksum of the current protected data contentstored protected data memory 221 equals a second checksum predefinedaccording to the initial values of the protected data.

Condition 3: A rewrite flag of protected data memory 221 is set to 1.

If the current protected data content and the initial, or default,values are not the same, that is, if any of the current protected datacontent has been updated at least once (step S402 returns “no”), thenthe current protected data content is stored, i.e. backed up, to theprotected data reserve memory 222, a rewrite flag of the protected datamemory 221 is cleared to 0 (S403), and the procedure ends.

However, if the initial values match the current protected data content,that is, the printer settings and history data have been cleared becauseof a repair, or the main circuit board has been replaced (S402 returns“yes”). In this case, reserved protected data content is read fromprotected data reserve memory 222 (S404) and compared with the presetinitial values of the protected data, which are preferably also storedin protected data reserve memory 222, to determine if the reserveprotected data content equals the initial, i.e. default, values(S405).The reserve protected data content is assumed to be set to the initialvalues if any of the following conditions are true.

Condition 1: The counter values for individual protected data, such asthe number of lines printed, printer operating time, automatic papercutter operations, and the number of memory rewrites stored in protecteddata reserve memory 222, are set to “0”.

Condition 2: A first checksum of the reserve protected data contentstored in protected data reserve memory 222 equals a second checksumpredefined according to the initial values of the protected data.

If the reserve protected data content is not set to the initial values,that is, if the protected data has been copied, i.e. backed up, at leastonce from the protected data memory 221 to the protected data reservememory 222 (i.e. step S405 returns “no”), the reserve protected datacontent read from the protected data reserve memory 222 is written to,i.e. restored to, the protected data memory 221 (S406), and theprocedure ends.

If the protected data is set to the initial values, that is, if theinterface device has been replaced (step S405 returns “yes”), it isdetermined whether the ID number of the main circuit board stored asprotected data in the protected data memory 221 is the same as the maincircuit board ID number stored as reserve protected data in theprotected data reserve memory 222 (S407). If they are not the same (stepS407 returns “no”), the main circuit board ID number stored in protecteddata memory 221 is written to the protected data reserve memory 222(S408), and the procedure ends. If the ID numbers are the same (stepS407 returns “yes”), the ID number is not copied and the procedure ends.

It will be obvious from the above description that this inventionprovides a printing apparatus capable of backing up and restoringprinter settings and operating history data, an interface device,printer control method, interface device control method, and acomputer-readable data storage medium recording a program achieving thedata backup and restore processes.

It is therefore possible to store at an appropriate time such data asprinter settings that have been updated from the default printersettings preset at the factory prior to shipping, and printer operatinghistory data such as ink consumption information, stored to rewritableprotected data memory provided on the main circuit board of the printerto a rewritable protected data reserve memory provided in the interfacedevice or other device other than the main circuit board. As a result,if the main circuit board malfunctions and is replaced, the protecteddata backed up to the rewritable protected data reserve memory can bewritten to the rewritable protected data memory of the replacement maincircuit board, thereby easily restoring the protected data.

The invention being thus described, it will be obvious that the same maybe varied in many ways. Such variations are not to be regarded as adeparture from the spirit and scope of the invention, and all suchmodifications as would be obvious to one skilled in the art are intendedto be included within the scope of the following claims.

1. A printing apparatus connected to a host device through an externalinterface device, said printing apparatus comprising: a nonvolatileprimary data memory unit for storing printing apparatus settings data; areceiver for receiving command data sent from said host device andrelayed by said external interface device; a printing unit for printingtext or image data when the received command data is a print commandspecifying text or image data; a data update unit for updating saidprinting apparatus settings data when the received command data requiresthe updating of settings data in said primary data memory unit; and abackup unit for copying settings data content from said primary datamemory unit to a reserve data memory unit in said external interfacedevice.
 2. A printing apparatus as described in claim 1, wherein saidbackup unit is triggered to copy and store the settings data contentfrom said primary data memory unit to said reserve data memory unit bythe settings data being updated by the data update unit.
 3. A printingapparatus as described in claim 1, wherein the backup unit copies andstores the settings data content from said primary data memory unit tosaid reserve data memory unit when the power to said printing apparatusturns on.
 4. A printing apparatus as described in claim 1, furthercomprising a power off command input for receiving a power-off commandindicating an interruption of power supply to said printing apparatus,wherein said backup unit is triggered to copy and store the settingsdata content from said primary data memory unit to said reserve datamemory unit by said power-off command being received.
 5. A printingapparatus as described in claim 1, further comprising a data restoreunit for copying the data content of said reserve data memory unit tosaid primary data memory unit.
 6. A printing apparatus as described inclaim 5, wherein said data restore unit copies the data content of saidreserve data memory unit to said primary data memory unit in response tosaid printing apparatus being turned on if said primary data memory unitdoes not hold current protected data and said current protected data isstored in said reserve data memory unit of said interface device.
 7. Aprinting apparatus as described in claim 1, wherein said reserve datamemory unit is a rewritable, nonvolatile reserve data memory unit.
 8. Aprinting apparatus as described in claim 1, wherein said settings datacontent that is copied from said primary data memory unit to saidreserve data memory unit is printing apparatus settings data.
 9. Aprinting apparatus as described in claim 1, wherein the copying of saidsettings data content from said primary data memory unit to said reservedata memory unit in said external interface device is fully undercontrol of said printing apparatus.
 10. A printing apparatus controlmethod for controlling a printing apparatus having a primary data memoryunit for storing settings data in a nonvolatile manner, and connected toa host device through an external interface device, said printingapparatus control method comprising: a receive step for receivingcommand data sent from said host device and relayed by said interfacedevice; a printing step for printing text or image data when thereceived command data is a print command specifying text or image data;a data update step for updating said settings data when the receivedcommand data is a command requiring the updating of settings data insaid primary data memory unit; and a backup step for copying andstoring, in a nonvolatile manner, settings data from said primary datamemory unit to a reserve data memory unit of said external interfacedevice.
 11. A printing apparatus control method as described in claim10, wherein said backup step copies and stores settings data from saidprimary data memory unit to said reserve data memory unit when thesettings data content of said primary data memory unit is updated bysaid data update step.
 12. A printing apparatus control method asdescribed in claim 10, wherein said backup step copies and storessettings data from said primary data memory unit to said reserve datamemory unit when power to said printing apparatus turns on.
 13. Aprinting apparatus control method as described in claim 10, furthercomprising a power off command input step for receiving a power offcommand indicating an interruption of a power supply to said printingapparatus, wherein said backup step copies and stores settings data fromsaid primary data memory unit to said reserve data memory unit inresponse to receiving said power off command.
 14. A printing apparatuscontrol method as described in claim 10, further comprising a datarestore step for copying and storing setting data from said reserve datamemory unit to said primary data memory unit.
 15. A printing apparatuscontrol method as described in claim 14, wherein the data restore stepis initiated when power to said printing apparatus turns on if currentsettings data is not stored within said primary data memory unit but isstored within said reserve data memory unit.
 16. A printing apparatuscontrol method as described in claim 10, wherein said settings data isprinting apparatus settings data.
 17. A printing apparatus controlmethod as described in claim 10, wherein in said backup step, thecopying and storing in a nonvolatile manner of settings data from saidprimary data memory unit to said reserve data memory unit of saidexternal interface device is fully under control of said printingapparatus.